<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags" %>
<%@ taglib tagdir="/WEB-INF/tags" prefix="p" %>
<%String ctx = request.getContextPath(); %>

<jsp:include page="../common/operate.jsp">
	<jsp:param name="title1" value="商业渠道管理"/>
	<jsp:param name="title2" value="流向列表 -- 查询结果"/>
</jsp:include>

<div style="width:100%" class="f_l margin1">
    <div id="search">
    <s:form id="searchForm" action="flow!search" method="post" theme="simple">
    <p>
    <s:text name="客户名称"/>：
    <select name="flow.terminalId" id="flow.terminalId">
        <option value="">-- 所有 --</option>
        <s:iterator value="allTerminals" status="status">
            <option value="${id}" <s:if test="%{flow.terminalId == id}">selected="selected"</s:if>>${name}</option>
        </s:iterator>
    </select>
    &nbsp;&nbsp; 
    
    <s:text name="产品名称"/>：
    <select name="flow.productId" id="flow.productId">
        <option value="">-- 所有 --</option>
        <s:iterator value="allProducts" status="status">
            <option value="${id}" <s:if test="%{flow.productId == id}">selected="selected"</s:if>>${name}</option>
        </s:iterator>
    </select>
    &nbsp;&nbsp; 
       
    <s:text name="区域"/>：
    <select name="flow.regionId" id="flow.regionId">
        <option value="">-- 所有 --</option>
        <s:iterator value="allRegions" status="status">
            <option value="${id}" <s:if test="%{flow.regionId == id}">selected="selected"</s:if>>${name}</option>
        </s:iterator>
    </select>
    &nbsp;&nbsp;
    </p>
    
    <p>
    <s:text name="上级连锁"/>：
    <select name="flow.channelId" id="flow.channelId">
        <option value="">-- 所有 --</option>
        <s:iterator value="allChannels" status="status">
            <option value="${id}" <s:if test="%{flow.channelId == id}">selected="selected"</s:if>>${name}</option>
        </s:iterator>
    </select>
    &nbsp;&nbsp;
    
    <s:text name="业务员"/>：
    <select name="flow.inChargeUserId" >
        <option value="">-- 所有 --</option>
	    <s:iterator value="allChargePersons" status="status">
	        <option value="${id}" <s:if test="%{flow.inChargeUserId == id}">selected="selected"</s:if>>${userName}</option>
	    </s:iterator>
    </select>
    &nbsp;&nbsp;
    
    <s:text name="销售时间"/>：
    <input value='<s:date name="flow.saleDate" format="yyyy-MM-dd" />' readonly="true" id="saleDate" style="width:80px" name="flow.saleDate" onclick="return showCalendar('saleDate', 'y-mm-dd');" />
    --
    <input value='<s:date name="flow.createdDate" format="yyyy-MM-dd" />' readonly="true" id="createdDate" style="width:80px" name="flow.createdDate" onclick="return showCalendar('createdDate', 'y-mm-dd');" />
    
    <input type="submit" value="查询"/>
    <input type="button" value="重置" onclick="resetFlowSearch('searchForm');">
    </p>
    </s:form>
    </div>
    <s:form id="listForm" method="POST" theme="simple">
    <table width="98%" cellspacing="0" cellpadding="0" border="0" class="clear f_l padding3" id="tb">
      <tr class="bg4_nav">
      	<td style="border:0">
	        <input onclick="javascript:batchSelect(this)" type="checkbox" style="border:0" name="List_Selected2" value="130abbf9b842053a91f587748638929f">
	    </td>
        <td class="t_c" style="border:0">序号</td>
        <td class="t_c" style="border:0">客户名称</td>
        <td class="t_c" style="border:0">产品名称</td>
        <td class="t_c" style="border:0">上级连锁</td>
        <td class="t_c" style="border:0">区域</td>
        <td class="t_c" style="border:0">数量</td>
        <td class="t_c" style="border:0">业务员</td>
        <td class="t_c" style="border:0">销售时间</td>
      </tr>
      <s:iterator value="pager.result" status="status">
      <tr onmouseover="this.bgColor='#F2E6E6'" onmouseout="this.bgColor=''">
        <td class="border_tb"><input type="checkbox" style="border:0" name="ids" value="${id }"></td>
        <td class="border_tb" style="cursor: pointer;" onclick="window.location.href='flow!listDetail.action?id=${id}'">
          ${status.index+1 }
        </td>
        <td class="border_tb" style="cursor: pointer;" onclick="window.location.href='flow!listDetail.action?id=${id}'">
          <s:property value="terminalName"/>
        </td>
        <td class="border_tb" style="cursor: pointer;" onclick="window.location.href='flow!listDetail.action?id=${id}'">
          <s:property value="productName"/>
        </td>
        <td class="border_tb" style="cursor: pointer;" onclick="window.location.href='flow!listDetail.action?id=${id}'">
          <s:property value="channelName"/>
        </td>
        <td class="border_tb" style="cursor: pointer;" onclick="window.location.href='flow!listDetail.action?id=${id}'">
          <s:property value="regionName"/>
        </td>
        <td class="border_tb" style="cursor: pointer;" onclick="window.location.href='flow!listDetail.action?id=${id}'">
          <s:property value="quantity"/>
        </td>
        <td class="border_tb" style="cursor: pointer;" onclick="window.location.href='flow!listDetail.action?id=${id}'">
          <s:property value="inChargeUserName"/>
        </td>
        <td class="border_tb" style="cursor: pointer;" onclick="window.location.href='flow!listDetail.action?id=${id}'">
          <s:date name="saleDate" format="yyyy年MM月dd日"/>
        </td>
      </tr>
      </s:iterator>
    </table>
    </s:form>
    <div class="f_l margin1"><img src="<%=ctx%>/img/business/main_07.jpg"></div>
</div>
<div style="width: 90%;margin-top: 20px;">
  <p:page pager="${pager}" url="flow!search.action" params="flow.terminalId=${flow.terminalId}&flow.productId=${flow.productId}&flow.regionId=${flow.regionId}&flow.channelId=${flow.channelId}&flow.inChargeUserId=${flow.inChargeUserId}&searchDateStartInMillis=${flow.saleDate.timeInMillis}&searchDateEndInMillis=${flow.createdDate.timeInMillis}" namespace="/flow"/>
</div>